# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=droidcam
pkgver=1.8.2
pkgrel=0
pkgdesc="GNU/Linux client for DroidCam"
url="https://github.com/dev47apps/droidcam/"
arch="all"
license="GPL-2.0-only"
makedepends="
	alsa-lib-dev
	ffmpeg-dev
	glib-dev
	gtk+3.0-dev
	libappindicator-dev
	libjpeg-turbo-dev
	libusbmuxd-dev
	linux-headers
	speex-dev
	"
subpackages="$pkgname-gui"
install="$pkgname.post-install"
source="https://github.com/dev47apps/droidcam/archive/refs/tags/v$pkgver/droidcam-$pkgver.tar.gz
	makefile.patch
	release-paths.patch
	"
options="!check"

build() {
	make
}

package() {
	install -Dm755 -t "$pkgdir"/usr/bin \
		droidcam \
		droidcam-cli

	install -Dm644 icon2.png "$pkgdir"/usr/share/droidcam/icon.png
	install -Dm644 droidcam.desktop -t "$pkgdir"/usr/share/applications
}

gui() {
	pkgdesc="$pkgdesc (GUI)"

	amove usr/bin/droidcam
	amove usr/share
}

sha512sums="
507f513c8d0dffa86afe5368ccab5461931e236b6352269a6eb5e970a79e5f9b386808da3466f3b391e955170b47b24a82663632ddc3c3c84e4de5988b7d3f8f  droidcam-1.8.2.tar.gz
7b3b3eb08deeb89de7d54909a34faf27dc2cd1cfde05e43897b4bb9d46e18f58fbbc8eb24bbd99c0e96beb737076f631dfe9590fe4467417db2d12093dce204d  makefile.patch
33da7e155447a75cc0d88274c4b053c3cb6867aba411176b82b968bb690d60d429d3a39b1caf3bafe79c0958b24f7f6777e42e88de7c71b7eb271d196b7d50b9  release-paths.patch
"
